<?php
/**
 * Created by PhpStorm.
 * User: mj
 * Date: 17-6-26
 * Time: 下午3:16
 */

namespace App\Winged\Evaluation\Api;


use Illuminate\Support\Facades\App;

class Api extends \App\Winged\Auth\Backend\Api\Api
{

    protected static $module = 'evaluation';

    public static $needToken = true ;

    /**
     * @param      $path
     * @param      $body
     * @param bool $sign
     * @return \Illuminate\Support\Collection|string
     * @throws \Exception
     */
    public static function doPost($path , $body ,$sign = false)
    {
        try{
            $body = ['data' => \GuzzleHttp\json_encode($body)];//
            list($status , $content) = app()->http->request(static::getPath($path) , 'POST' , $body ,self::getHeader());
            self::handleStatus($status);
            return self::handleResponse($content);
        }catch (\Exception $e){
            if(App::environment('local')){
                echo $e->getMessage();
                die ;
            }
        }
    }
}



















